﻿#pragma once

#include "Game.h"
#include "GameBoard.h"
#include "RivalWindow.h"

// 主窗口
class MainWindow: public CDialog {
    DECLARE_MESSAGE_MAP()

    private: Game* mGame;               // 游戏
    private: GameBoard mGameBoard;      // 游戏区域
    private: RivalWindow mRivalWindow;  // 对手列表窗口
    private: CStatusBarCtrl mStatusBar; // 状态栏

    public: MainWindow(CWnd* parent = NULL);
    public: ~MainWindow();
    private: void Logon();
    private: afx_msg LRESULT OnGameOver(WPARAM, LPARAM);
    private: afx_msg LRESULT OnGameStart(WPARAM, LPARAM);
    private: afx_msg LRESULT OnGetFindUsersResult(WPARAM, LPARAM);
    private: afx_msg LRESULT OnGetInviteRequest(WPARAM, LPARAM);
    private: afx_msg LRESULT OnGetInviteResult(WPARAM, LPARAM);
    private: afx_msg LRESULT OnGetLogonResult(WPARAM, LPARAM);
    private: afx_msg LRESULT OnGetRivalName(WPARAM, LPARAM);
    private: virtual BOOL OnInitDialog();
    private: afx_msg void OnLButtonUp(UINT, CPoint);
    private: afx_msg void OnMenuItemDefeatClicked();
    private: afx_msg void OnMenuItemFindUsersClicked();
    private: afx_msg void OnMenuItemRestartClicked();
    private: afx_msg LRESULT OnRivalQuitGame(WPARAM, LPARAM);
};
